#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<sstream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int a, b;
	char flag = '0';
	char arr[1001] = { 0 };
	string s;
	stringstream stream; 
	while (n--) {
		cin >> s;
		if (s[0] >= 'a' && s[0] <= 'c') {
			flag = s[0];
			cin >> a >> b;
		}
		else {
			stream.clear();
			stream << s;
			stream >> a;
			cin >> b;
		}
		if (flag == 'a') {
			sprintf(arr, "%d+%d=%d", a, b, a + b);
		}
		else if (flag == 'b') {
			sprintf(arr, "%d-%d=%d", a, b, a - b);
		}
		else {
			sprintf(arr, "%d*%d=%d", a, b, a * b);
		}
		cout << arr << endl;
		cout << strlen(arr) << endl;
	}
	return 0;
}